import request from "@/utils/request";

// 查询考勤组管理列表
export function attendanceListPost(query) {
  return request({
    url: "/attendance/group/list",
    method: "get",
    params: query,
  });
}

// 查询考勤组管理详细
export function attendanceGetPost(postId) {
  return request({
    url: "/attendance/group/" + postId,
    method: "get",
  });
}

// 根据班次-工作日id查询详情信息
export function getAttendanceShiftApi(id) {
  return request({
    url: `/attendance/shift/getWorkShift/${id}`,
    method: "get",
  });
}

// 获取休息日打卡规则详情
export function getDayOffRuleApi(id) {
  return request({
    url: `/attendance/group/getDayOffRule/${id}`,
    method: "get",
  });
}

// 获取外勤打卡配置详情
export function getLegworkConfigApi(id) {
  return request({
    url: `/attendance/group/getLegworkConfig/${id}`,
    method: "get",
  });
}

// 获取打卡方式详情
export function getClockInDetailsApi(query) {
  return request({
    url: `/attendance/group/getClockInDetail`,
    method: "get",
    params: query,
  });
}

// 新增考勤组管理
export function attendanceAddPost(data) {
  return request({
    url: "/attendance/group",
    method: "post",
    data: data,
  });
}

// 修改考勤组管理
export function attendanceUpdatePost(data) {
  return request({
    url: "/attendance/group",
    method: "put",
    data: data,
  });
}

// 删除考勤组管理
export function attendanceDelPost(postId) {
  return request({
    url: "/attendance/group/" + postId,
    method: "delete",
  });
}

// 获取考勤组人数和不在该考勤组的人数及人员信息
export function getPeopleCountInfoApi(data) {
  return request({
    url: "/attendance/group/getPeopleCountInfo",
    method: "post",
    data: data,
  });
}

// 加班规则分页列表
export function getOvertimeListApi(query) {
  return request({
    url: "/attendance/overtime/list",
    method: "get",
    params: query,
  });
}

// 获取所有考勤组名称和id
export function getGroupListApi() {
  return request({
    url: "/attendance/group/listAllGroup",
    method: "get",
  });
}

// 新增加班规则
export function addOverTimeApi(data) {
  return request({
    url: "/attendance/overtime",
    method: "post",
    data: data,
  });
}

// 删除加班规则
export function deleteOvertimeApi(postId) {
  return request({
    url: "/attendance/overtime/" + postId,
    method: "delete",
  });
}

// 根据id查询加班规则详情
export function getOvertimeByIdApi(postId) {
  return request({
    url: "/attendance/overtime/" + postId,
    method: "get",
  });
}

// 修改加班规则
export function putOvertimeApi(data) {
  return request({
    url: "/attendance/overtime",
    method: "put",
    data: data,
  });
}
